<?php

class Server extends AppModel {

    public $label = 'Servidores';
    public $useTable = 'msg_servers';
    public $displayField = 'host';
    public $plugin = 'Messaging';
    public $hasMany = array('Messaging.Mensaje');
    public $validate = array(
        'tipo' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'El tipo es requerido'
            )
        ),
        'host' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'El host es requerido'
            )
        ),
        'puerto' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'El puerto es requerido'
            ),
            'number' => array(
                'rule' => array('numeric'),
                'message' => 'El puerto debe ser un número'
            )
        ),
        'usuario' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'El usuario es requerido'
            )
        ),
        'clave' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'La clave es requerida'
            )
        ),
        'cuenta' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'La cuenta es requerida'
            )
        )
    );
    

}